<div class="entry" style="margin-top: 5px;margin-bottom: 10px;">
	<div style="float: left;text-align: center;" class="rating-block-item">

		<div class="" style="padding-top: 10px;padding-bottom: 10px;">
			<? $this->widget("UserRating", array(
                                             "item_id" => $suggest->id,
                                             "type" => Rating::TYPE_SUGGEST,
                                             'rating' => $suggest->rating,
                                             'is_down' => Y::userId() !== $suggest->owner_id && empty($suggest->rt)

                                         )
            );?>
		</div>
		<?

		$this->widget("HelpedSuggest", array(
            'user_id' => Y::userId(),
            "item_id" => $suggest->id,
            "owner_id" => $suggest->owner_id,
            "is_helped" => $is_helped,
            "visible" => $suggest->status == 0 && Y::isAuthed() ? true : false
        ));

		?>
	</div>

	<h2 class="title"><?php echo CHtml::encode($suggest->title); ?></h2>

	<div class="text-block">
		<p><?= YText::cleanRepair($suggest->text);?></p>

		<div style="float: left;width:350px;text-align: left;">
			<?= $suggest->getDownloadLink();?>
            <? $this->widget("ActionSuggest", array("suggest" => $suggest, 'visible'=>$suggest->owner_id == Y::userId() && $suggest->status ==0));?>

		</div>
		<div style="float: right;width:350px;text-align: right;">
            <?= Yii::t("lan","{n} просмотр|{n} просмотра|{n} просмотров",$suggest->count_view);?> ::
			<em><?= DateTimer::getPeriod($suggest->t_create);?></em>

			<div>

				<b class="tegs">Метки:</b>
				<?  $i = 1; foreach ($suggest->tags as $tag) { ?>
				<?= CHtml::link($tag->name, "/suggest/list?filter=" . $tag->name) ?><?= count($suggest->tags) > $i
						? ", " : ""
				; ?>
				<? $i++;
			}?>
			</div>
		</div>
		<div class="clear"></div>
	</div>
	<div style="margin-left:90px;">
		<?php $this->widget('WSocialButton', array('style'=>'standard'));?>
	</div>
	<br/>
	<? if ($suggest->status == 1) { ?>
	<span class="error " style="margin-left:90px;">
            <?= $suggest->getStatusName();?>
        </span>
	<? }?>
	<div class="clear"></div>
</div>
<?if ($item_suggests || $item_services) { ?>
<div class="infobox" style="margin-left:90px;padding: 30px;border: 2px dashed #6DA3BD;">
	<div class="widget" style="float: left;width: 45%;">
		<?if ($item_suggests) { ?>
		<h5 class="widget-title" style="line-height: 16px;margin-bottom:4px; color:#666;">Похожие темы:</h5>
		<? foreach ($item_suggests as $item) { ?>
			<div>
				<a href="/suggest/<?= $item->id?>" style="font-size: 14px;"><?= $item->title;?></a>
			</div>
			<? } ?>
		<? } ?>
	</div>

	<div class="widget" style="float: right;width: 50%;padding-left:20px;border-left: 2px dashed #6DA3BD;">
		<?if (Yii::app()->user->id == $suggest->owner_id && $item_services && $suggest->status == 0) { ?>
		<h5 class="widget-title" style="line-height: 16px;margin-bottom:4px; color:#666;">Вы можете помочь им:</h5>
		<? foreach ($item_services as $item) { ?>
			<div>
				<a href="/service/<?= $item->id?>" style="font-size: 14px;"><?= $item->title;?></a>
			</div>
			<? } ?>
		<? }  ?>
	</div>
	<div class="clear"></div>
</div>
<? } ?>
<a name="comment"></a>
<hr/>
<? if ($suggest->comments) { ?>
<div class="content" id="blog">
	<h4>Комментарии (<?= count($suggest->comments);?>):</h4>
	<?php $this->renderPartial('_comment', array('post' => $suggest, 'comments' => $suggest->comments)); ?>
</div>
<? } ?>
<? if (Y::isAuthed()) { ?>

<div class="response">
	<h3>Оставить комментарий</h3>
	<?php if (Yii::app()->user->hasFlash('commentSubmitted')): ?>
	<div class="flash-success">
		<?= Yii::app()->user->getFlash('commentSubmitted'); ?>
	</div>
	<?php else: ?>
	<?php $this->renderPartial('/comment/_form', array('model' => $comment)); ?>
	<?php endif; ?>
</div>
<? } ?>
